import { createStore } from 'vuex'
import persistent from './plugins/persistent'

const globs = import.meta.globEager('./modules/*.ts')
const modules={}
for (const path in globs) {
  const mod=globs[path]
  const key=path.match(new RegExp('\./modules/(.*)\.ts'))[1]
  if(key){
    modules[key]=mod
  }
}

const state=() => ({
  
})
const mutations={ 

}
const actions={ 

}
const getters={ 

}
const plugins=[persistent(localStorage)]
const store = createStore({
  state,mutations,actions,getters,modules,plugins
})

export default store